<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminEducationTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_education', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('group_id')->comment('团队ID');
            $table->integer('user_id')->comment('负责人ID');
            $table->string('title')->default('')->comment('标题');
            $table->string('description')->default('')->comment('简介');
            $table->tinyInteger('educational_type')->comment('项目类型  0按照学期 1按照学年');
            $table->string('address')->default('')->comment('地址');
            $table->string('longitude')->default('')->comment('经度');
            $table->string('latitude')->default('')->comment('纬度');
            $table->decimal('target_amount')->comment('目标金额');
            $table->string('cover_path')->default('')->comment('封面');
            $table->text('content')->comment('内容');
            $table->string('student_name')->default('0')->nullable()->comment('学生姓名');
            $table->tinyInteger('student_sex')->nullable()->comment('性别 0女 1男');
            $table->date('student_birthday')->default('0000-00-00')->nullable()->comment('生日');
            $table->integer('school_id')->nullable()->comment('学校');
            $table->date('enrollment_year')->nullable()->comment('入学年份');
            $table->string('source')->nullable()->comment('来源');
            $table->string('class_name')->nullable()->comment('所在班级');
            $table->string('student_phone')->nullable()->comment('联系电话');
            $table->string('head_teacher')->nullable()->comment('班主任姓名');
            $table->string('head_teacher_phone')->nullable()->comment('班主任电话');
            $table->string('guardian_name')->nullable()->comment('监护人姓名');
            $table->string('guardian_phone')->nullable()->comment('监护人电话');
            $table->string('guardian_relation')->nullable()->comment('监护人与本人关系');
            $table->string('payment_info')->nullable()->comment('收款信息');
            $table->string('student_address')->nullable()->comment('居住地址');
            $table->tinyInteger('online_status')->nullable()->comment('在线状态 0下线 1上线');
            $table->tinyInteger('audit_status')->default('0')->nullable()->comment('审核状态 0未审核  1已审核通过 2审核驳回');
            $table->string('audit_response')->nullable()->comment('审核驳回原因');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin_education');
    }
}
